package com.why;


import com.why.annotaion.RpcScan;

import com.why.app.AnnotationServiceScanApplicationContext;
import com.why.loadbalance.RoundRobinLoadBalancer;
import com.why.nacos.DefaultNacosServiceRegistry;
import com.why.provider.DefaultServiceProvider;
import com.why.provider.ServiceProvider;
import com.why.serializable.KroSerializer;
import com.why.server.NettyRpcServer;

import com.why.server.Server;

@RpcScan
public class TestServer {
    public static void main(String[] args) {

        ServiceProvider provider = new DefaultServiceProvider();
        Server server = (Server) NettyRpcServer
                .builder()
                .host("localhost")
                .port(8080)
                .provider(new DefaultServiceProvider())
                .registry(new DefaultNacosServiceRegistry())
                .serializable(new KroSerializer())
                .build();
        AnnotationServiceScanApplicationContext context = new AnnotationServiceScanApplicationContext(server);
        context.scanServicesApplication(null).start();


    }
}